#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<stdlib.h>
int main()
{
    // write code here
    int n = 0;
    scanf("%d", &n);

    int** arr = (int**)malloc(sizeof(int*) * n);
    for (int i = 0; i < n; i++)
    {
        arr[i] = (int*)malloc(sizeof(int) * (i + 1));
    }
    for (int i = 0; i < n; i++)
    {
        arr[i][0] = 1;
        arr[i][i] = 1;
    }
    for (int i = 2; i < n; i++)
    {
        for (int j = 1; j < i; j++)
        {
            arr[i][j] = arr[i - 1][j] + arr[i - 1][j - 1];
        }
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j <= i; j++)
        {
            printf("%d ", arr[i][j]);
        }
        printf("\n");
    }
	return 0;
}